<!-- http://www.imooc.com/wiki/uniapp/databinding.html -->
<template>
  <view>
    <picker @change="chooseName" :value="index" :range="names">
      <view v-if="index == '0'">
        哈哈哈哈哈哈
      </view>
	  <view v-else-if="index == '1'">
	    ~~~~~~~~~
	  </view>
	  <view v-else>
		  我的名字是：{{names[index]}}
	  </view>
    </picker>
  </view>
</template>

<script>
	export default {
	  data () {
		return {
		  index: 0,
		  names: ['小慕课', '大慕课', '老慕课'],
		  user_info: {
			phone_number: null,
			selected_major: '',
			
			name: '',
			sex: '',
			current_school: '',
			current_class: '',
			address_detail: '',
			
			address_selected: '',
			
			picture_id_card_positive: '',
			picture_id_card_negative: '',
			picture_sign: '',
		  },
		}
	  },
	  onLoad(){
		  console.log('~~~', this.index);
	  },
	  methods: {
		chooseName (e) {
		  console.log("当前选择名字的索引是：",e.detail.value);
		  this.index = e.detail.value;
		  console.log('--- index:', this.index);
		}
	  }
	}
</script>
